package com.ywt.cda.utils;

import java.util.UUID;

import com.ywt.cda.constants.DateConstants;

public class UUIDUtils
{
	/**
	 * 
	 * @Title: getSerialNumber
	 * @Description: TODO(生成唯一流水号规则为 coCode（7 位）+YYYYMMDDHHMMSS(14 位)+5 位流水号)
	 * @param @return 设定文件
	 * @return String 返回类型
	 * @throws
	 */
	public static String getPkid()
	{
		StringBuffer sb = new StringBuffer();
		sb.append(DateUtils.format(DateConstants.FORMAT_NOGAP));
		int hashCode = UUID.randomUUID().toString().hashCode();
		if (hashCode < 0)
		{
			hashCode = -hashCode;
		}
		String str = String.format("%010d", hashCode);
		sb.append(str);
		return sb.toString();
	}
}
